package com.dyw;

import com.dyw.ba01.SomeService;
import com.dyw.ba01.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @auther Devil
 * @create 2022-01-07-14:22
 */
public class MyTest05 {
    @Test
    public void test05() {
        String config = "applicationContext06.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        SomeService proxy = (SomeService) ac.getBean("someService");
        Student student = proxy.doFirst("阿坤", 20);//myAround
        System.out.println(student);
        /**
         * 有接口的情况下使用cglib方式代理
         */
        System.out.println(proxy.getClass().getName());
    }
}
